<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>v-on</title>
	</head>
	<body>
		
		<div id='app'>
			<input type="button" value="v-on指令" v-on:click="doIt">
			<input type="button" value="v-on简写" @click="doIt">
			<input type="button" value="v-on双击" @dblclick="doIt">
			<h2 @click="changeFood">{{ food }}</h2>
		</div>
		
		 <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script>	 
		var vm = new Vue({
				 el: "#app",
				 data: {
					 food:"仰望星空，"
				 },
				 methods: {
					 doIt:function(){
						 alert("do it");
					 },
					
					changeFood:function(){
						//console.log(this,food);
						this.food+="好吃！"
					}
				 },
			 })
	    
		
		 </script>
	</body>
</html>

<!--
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<div id='app'>
			
		</div>
		
		 <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script>	 
		var vm = new Vue({
				 el: "#app",
				 
			 })
	    
		
		 </script>
	</body>
</html>
-->